package com.example.appointment.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.example.appointment.R;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * 编辑用户信息的界面
 */
public class EditUserInfoActivity extends BaseActivity {
    @Bind(R.id.acitivity_edituserinfo_area_text)
    TextView areatext;
    @Bind(R.id.activity_editsignature_text)
    TextView signaturetext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setnotificationColore(R.color.maincolor);//設置导航栏顔色
        setContentView(R.layout.activity_edituserinfo);
        initView();

    }

    /**
     *
     */
    private void initView() {
        setTitile("编辑个人资料");
    }

    /**
     * 选择对应的地区
     */
    @OnClick(R.id.acitivity_edituserinfo_area)
    public void choosearea() {
        startActivityForResult(new Intent(EditUserInfoActivity.this, ChooseAreaActivity.class), 0x001);

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            switch (requestCode) {
                case 0x001:
                    //选择地区的回掉
                    areatext.setText(data.getStringExtra("area"));
                    break;
                case 0x111:
                    //个性签名的回调
                    signaturetext.setText(data.getStringExtra("signature"));
                default:
                    break;
            }
        }
    }

    @OnClick(R.id.activity_editsignature_layout)
    public void editsignature() {
        EditUserInfoActivity.this.startActivityForResult(new Intent(EditUserInfoActivity.this, EditSignatureActivity.class), 0x111);
    }

}
